Skip to content

Add working directory option and /home/ubuntu directory validation#3

Closed
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1745129346-add-working-directory-option
Closed

Add working directory option and /home/ubuntu directory validation#3
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1745129346-add-working-directory-option

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Working Directory Option and $HOME Validation

This PR adds:

  • New CLI option to specify the working directory for command execution (-w, --working-dir)
  • Validation to ensure commands are only executed in directories under $HOME
  • Updated documentation with the new option and parameter
  • Added tests for the new functionality

Implementation Details

  • Added getWorkingDir() function to retrieve working directory from CLI options or default to $HOME
  • Added isUnderHome() function to validate paths are under the user's home directory
  • Updated shell_exec tool to support working directory parameter
  • Added comprehensive tests for path validation

Testing

  • Compiled successfully with pnpm build
  • All tests passing with pnpm test
  • Verified that commands outside $HOME are rejected with appropriate error message

Link to Devin run: https://app.devin.ai/sessions/bd23fbf0492b460f851d2f1f910e60ca
Requested by: hinoshita1992@gmail.com

Co-Authored-By: hinoshita1992@gmail.com <hinoshita1992@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Closing in favor of PR #5 which includes these changes plus additional improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants